<?php

/**
 * ClienteJuridico form.
 *
 * @package    blackDrums
 * @subpackage form
 * @author     your name here
 */
class ClienteJuridicoForm extends BaseClienteJuridicoForm {
    public function configure() {

        $this->widgetSchema['rif'] = new sfWidgetFormInputText();
        $this->validatorSchema['rif'] = new sfValidatorInteger();

        $personaContacto = new ContactoEmpresa();
        $personaContacto->setClienteJuridico($this->getObject());
        $form = new ContactoEmpresaForm($personaContacto);
        $this->embedForm('contacto', $form);

        $this->setValidators(array(
                'rif'    => new sfValidatorPropelChoice(array('model' => 'ClienteJuridico', 'column' => 'rif', 'required' => false)),
                'nombre'       => new sfValidatorString(array('max_length' => 30), array ('required' => 'Por favor indique el nombre del cliente')),
                'contacto' => new sfValidatorString(array('max_length' => 30),array ('required' => 'Por favor indique el nombre del cliente')),
        ));
    }

}
